home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 3.4 KB | 127 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWInk.h
- // Release Version: $ 1.0d1 $
- //
- // Creation Date: 3/28/94
- //
- // Copyright: © 1993, 1994 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWINK_H
- #define FWINK_H
-
- #ifndef FWGROBJ_H
- #include "FWGrObj.h"
- #endif
-
- #ifndef FWGCONST_H
- #include "FWGConst.h"
- #endif
-
- #ifndef FWCOLOR_H
- #include "FWColor.h"
- #endif
-
- // ----- Macintosh Includes -----
-
- #if defined(FW_BUILD_MAC) && !defined(__QUICKDRAW__)
- #include <QuickDraw.h>
- #endif
-
- //========================================================================================
- // •• Forward Class Declarations
- //========================================================================================
-
- class FW_CGraphicContext;
- class FW_CInkRep;
-
- //========================================================================================
- // •• CLASS FW_CInk
- //========================================================================================
-
- class FW_CInk : public FW_CGraphicObjectPtr
- {
- public:
- FW_CInk();
- FW_CInk(const FW_CColor& foreColor,
- const FW_CColor& backColor = FW_kRGBWhite,
- FW_TransferMode tranferMode = FW_kCopy);
- FW_CInk(const FW_CInk& other);
- FW_CInk(FW_CInkRep* rep);
-
- FW_CInk& operator=(const FW_CInk& other);
- FW_CInk& operator=(FW_CInkRep* other);
-
- FW_CInkRep* operator->() const;
- };
-
- //----------------------------------------------------------------------------------------
- // • FW_CInk::operator->
- //----------------------------------------------------------------------------------------
- inline FW_CInkRep* FW_CInk::operator->() const
- {
- return (FW_CInkRep*)GetRep();
- }
-
- //==============================================================================
- // •• class FW_CInkRep
- //==============================================================================
-
- class FW_CInkRep : public FW_CGraphicObjectRep
- {
- friend class FW_CInk;
-
- //------------------------------------------------------------------------------
- // • Inherited API
- //
- public:
- virtual void Flatten(FW_CWritableStream& stream);
- virtual void Unflatten(FW_CReadableStream& stream);
-
- //------------------------------------------------------------------------------
- // • New API
- //
- public:
- void SetForeColor(const FW_CColor& foreColor);
- void GetForeColor(FW_CColor& foreColor) const
- {foreColor = fForeColor;}
-
- void SetBackColor(const FW_CColor& backColor);
- void GetBackColor(FW_CColor& backColor) const
- {backColor = fForeColor;}
-
- void SetTransferMode(FW_TransferMode transferMode);
- FW_TransferMode GetTransferMode() const
- {return fTransferMode;}
-
- FW_CInk Copy() const;
-
- //------------------------------------------------------------------------------
- // • Constructors/Destructors
- //
- private:
- FW_CInkRep();
- FW_CInkRep(const FW_CInk& ink);
- FW_CInkRep(const FW_CColor& foreColor, const FW_CColor& backColor, FW_TransferMode transferMode);
- virtual ~FW_CInkRep();
-
- //------------------------------------------------------------------------------
- // • Public but for internal use only
- //
- public:
- void SelectInGC(FW_CGraphicContext* gc, FW_ShapeCategory shapeCategory);
-
- //------------------------------------------------------------------------------
- // • Data Members
- //
- private:
- FW_CColor fForeColor;
- FW_CColor fBackColor;
- FW_TransferMode fTransferMode;
- };
-
-
- #endif
-